package org.learn.controller;


import net.sf.ehcache.search.parser.ModelElement;
import org.apache.shiro.SecurityUtils;
import org.learn.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelExtensionsKt;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

    /**
     * 跳转至首页
     *
     * @return
     */
    @RequestMapping("/index")
    public String index(Model model) {
        User user = (User) SecurityUtils.getSubject().getPrincipal();  //获取用户信息
        model.addAttribute("user", user);
        return "index";
    }
}
